<?php

namespace App\Http\Controllers\Estate;

use App\Http\Controllers\Controller;
use App\Models\WaterBill;
use Illuminate\Http\Request;

class WaterBillController extends Controller
{
    public function index(Request $request)
    {
        $limit = $request->get('limit', 20);
        $data = WaterBill::query()->where('type', 2)->with(['owner:id,username,mobile', 'ele:id,name,code', 'community:name'])->orderByDesc('id')->paginate($limit);

        return $this->success($data);
    }
}
